#!/bin/sh
# Simple standalone build script for when not building in wine tree

# Figure out what the tools are named
# Varies from system to system
for CROSS in \
    i586-mingw32msvc- \
    i686-pc-mingw32- \
    i686-w64-mingw32- \
    i386-mingw32- \
    "MinGW Not Found "
do
    test `which ${CROSS}windres 2>/dev/null` && break
done

set -e
set -x

# Create output in "bin"
if [ ! -d "bin" ]; then
    mkdir bin
fi

# Includes copied from wine/include.
# This allows compilation on Windows.
INCLUDES="-I../include"

# Build
${CROSS}gcc -g -Wall ${INCLUDES} main.c -loleaut32 -ldxguid -lole32 -luser32 -o bin/dxdiagntest.exe
